<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
/*
三元表达式：有三个运算符组成的式子
语法结构：条件判断？表达式1：表达式2
执行顺序：
1.条件判断
2. 1 true 表达式1的值返回
2. 2 false 表达式二的值返回  

*/
let hero ='李白';
let result = null;
/* 
if (hero == '李白'){
    console.log();
    result='victory';
}else {
    result = 'defeat'
} */


result =(hero == '李白')?'victory':'no';
console.log(result);


    </script>
</body>
</html>